﻿
package extremefx.collections {
	import extremefx.IEnumerator;	
	
	/**
	 * @author Marcelo Volmaro
	 */
	public final class NativeArrayEnum implements IEnumerator {
		private var _array:Array;
		private var _idx:int;
		private var _len:int;
		
		public function NativeArrayEnum(pA:Array) {
			_array = pA;
			reset();
		}
		
		public function moveNext():Boolean {
			return (++_idx) < _len;
		}
		
		public function reset():void {
			_idx = -1;
			_len = _array.length;
		}
		
		public function get current():* {
			return _array[_idx];
		}
	}
}
